package com.xz.simplerpc.rpc;


import com.xz.simplerpc.api.ScoreService;

/**
 * Created by fingal on 2018/1/8.
 */
public class ConsumerMain {
    public static void main(String[] args) throws InterruptedException {
        ReferenceConfig<ScoreService> referenceConfig = new ReferenceConfig();
        RegistryConfig registryConfig = new RegistryConfig("registry://127.0.0.1:2181");
        referenceConfig.setRegistryConfig(registryConfig);
        referenceConfig.setInterfaceClass(ScoreService.class);
        ScoreService scoreService = referenceConfig.get();

        for(int i=0; i<=1000; i++) {
            System.out.println(scoreService.query("小泽"));
            Thread.sleep(5000);
        }

        while (true) {
            Thread.sleep(100);
        }
    }
}
